Skip to content

fix: backward selection creates inverted SelectionRange on Alt+click#516

Merged
xiaolai merged 1 commit intomainfrom
fix/511-backward-selection-inverted-range
Mar 23, 2026
Merged

fix: backward selection creates inverted SelectionRange on Alt+click#516
xiaolai merged 1 commit intomainfrom
fix/511-backward-selection-inverted-range

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 23, 2026

Summary

  • Fix inverted SelectionRange when converting a backward (right-to-left) selection to MultiSelection via Alt+click
  • Use selection.$from/$to (always ordered) instead of $anchor/$head (direction-dependent)

Closes #511

Test plan

  • Select text right-to-left, then Alt+click elsewhere — verify second cursor is added correctly
  • Select text left-to-right, then Alt+click elsewhere — verify behavior unchanged
  • Alt+click multiple times to add 3+ cursors with mixed selection directions

🤖 Generated with Claude Code

Backward selections (right-to-left) produced inverted ranges because
SelectionRange($anchor, $head) does not reorder its arguments.
Switch to $from/$to which are always ordered.

Closes #511

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude claude bot enabled auto-merge (squash) March 23, 2026 09:43
@xiaolai xiaolai merged commit 8cf0612 into main Mar 23, 2026
8 checks passed
@xiaolai xiaolai deleted the fix/511-backward-selection-inverted-range branch March 23, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[audit] multi-cursor: backward selection creates inverted SelectionRange on Alt+click

1 participant